import request from '@/utils/request'

// 查询收料单信息列表
export function listInfo(query) {
  return request({
    url: 'material/ReceiptMaterial/list?pageNum=1&pageSize=10',
    method: 'get',
    params: query
  })
}

// 查询收料单信息详细
export function getInfo(id) {
  return request({
    url: 'material/ReceiptMaterialInfo/' + id,
    method: 'get'
  })
}

// 新增收料单信息
export function addInfo(data) {
  return request({
    url: 'material/ReceiptMaterial',
    method: 'post',
    data: data
  })
}

// 编辑收料单信息
export function updateInfo(id) {
  return request({
    url: 'material/ReceiptMaterial',
    method: 'put',
    "id": id
  })
}

// 删除收料单信息
export function delInfo(id) {
  return request({
    url: 'material/ReceiptMaterial/' + id,
    method: 'delete'
  })
}


// 供应商名称下拉框
export function supplierDropDown(data) {
  return request({
    url: 'supplier/supplier/list',
    method: 'get',
    data:data
  })
}

// 物料类别下拉框
export function materialDrop(data) {
  return request({
    url: 'material/material/list',
    method: 'get',
    data:data
  })
}


// 确认入库
export function wonfirmWarehousing(id) {
  return request({
    url: 'material/ReceiptMaterial/status/' + id,
    method: 'get',
  })
}

// 查询信息接口
export function Querying(id) {
  return request({
    url: 'material/ReceiptMaterial/' + id,
    method: 'get',
  })
}

// 修改接口
export function Xiugai(data) {
  return request({
    url: 'material/ReceiptMaterial',
    method: 'put',
    data:{
        "id": data.id,
        "supplierName": data.supplierName,
        "supplierTheme": data.supplierTheme,
        "transportUnit": data.transportUnit,
        "freight": data.freight,
        "materialPerson": data.materialPerson,
        "materialTime": data.materialTime,
        "warehouseName": "仓库名称",
        "warehouseArea": "仓库区域",
        "materialInfoList": [
            {
                "materialType": "物料编号",
                "materialName": "物料名称",
                "specifications": "规格",
                "unit": "单位",
                "count": 69,
                "projectNo": "项目编号"
            }
        ]
    }
  })
}
